package com.powernode.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.powernode.domain.Bills;
import com.powernode.dto.BillsDto;
import com.powernode.mapper.BillsMapper;
import com.powernode.service.BillsService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
*内容: 
*作者: cy
*/   
    
   
@Service
public class BillsServiceImpl implements BillsService {

    @Resource
    private BillsMapper billsMapper;

    @Override
    public int deleteByPrimaryKey(Integer id) {
        return billsMapper.deleteByPrimaryKey(id);
    }

    @Override
    public int insert(Bills record) {
        return billsMapper.insert(record);
    }

    @Override
    public int insertSelective(Bills record) {
        return billsMapper.insertSelective(record);
    }

    @Override
    public Bills selectByPrimaryKey(Integer id) {
        return billsMapper.selectByPrimaryKey(id);
    }

    @Override
    public int updateByPrimaryKeySelective(Bills record) {
        return billsMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Bills record) {
        return billsMapper.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo<Bills> queryBills(BillsDto billsDto) {
        Page<Bills> billsPage = PageHelper.startPage(billsDto.getPage(),billsDto.getLimit());
        billsMapper.queryBills(billsDto);
        return billsPage.toPageInfo();
    }

}
